import java.util.Arrays ;
public class Test {
    public static void func1(int[] array){
        array = new int[]{15,16,17};
    }
    public static void func2(int[] array){
        array[0] = 999;
    }

    public static void main(String[] args) {
        int[] array1 = {1,2,3,4};
        //func1(array1);
          func2(array1);
        System.out.println(Arrays.toString(array1));

        int[]arr = null;
        System.out.println(arr[0]);
    }
    public static void main1(String[] args) {
        int[]array = new int[]{10, 20, 30, 40, 50};
        System.out.println(array[0]);
        System.out.println(array[1]);
        System.out.println(array[2]);
        System.out.println(array[3]);
        System.out.println(array[4]);

        //也可以通过对数组的中的元素进行修改
        array[0] = 100;
        System.out.println(array[0]);
    }

    public static void main2(String[] args) {
        int[] array = {1,2,3};
        for(int x:array){
            System.out.println(x);
        }
    }

    public static void main3(String[] args) {
        int[] array1 = {1,2,3,4};
        int[] array2 = {11,22,33,44};
        array1 = array2 ;
        array1 [0] = 1888;
        System.out.println(Arrays.toString(array1));
        System.out.println(Arrays.toString(array2));



    }
}